import { defineConfig, presetUno, presetAttributify, presetIcons, presetTypography, presetWind } from 'unocss'

export default defineConfig({
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons({
      collections: {
        mdi: () => import('@iconify/json/json/mdi.json').then(i => i.default),
        tabler: () => import('@iconify/json/json/tabler.json').then(i => i.default),
        heroicons: () => import('@iconify/json/json/heroicons.json').then(i => i.default),
        ri: () => import('@iconify/json/json/ri.json').then(i => i.default),
      },
    }),
    presetTypography(),
    presetWind(),
  ],
  rules: [
    // 自定义滚动条样式
    ['custom-scrollbar', {
      'overflow-y': 'auto',
      'scrollbar-width': 'thin',
      'scrollbar-color': '#cbd5e1 #f1f5f9',
    }],
    ['custom-scrollbar::-webkit-scrollbar', {
      'width': '8px',
    }],
    ['custom-scrollbar::-webkit-scrollbar-track', {
      'background': '#f1f5f9',
      'border-radius': '4px',
    }],
    ['custom-scrollbar::-webkit-scrollbar-thumb', {
      'background': '#cbd5e1',
      'border-radius': '4px',
      'border': '1px solid #f1f5f9',
    }],
    ['custom-scrollbar::-webkit-scrollbar-thumb:hover', {
      'background': '#94a3b8',
    }],
  ],
})
